< previous page page_65 next page >

Page 65
 Set the nuber of copies and from/to page values before going to the
 printer.
    StartPage = dlgFileSelect.FromPage
    EndPage = dlgFileSelect.ToPage
    FileCopies = dlgFileSelect.Copies
End Sub
Again, you can see that the actual call to the Common Dialog control remains pretty much the same. When you need to see whether a particular value was set in the Flags property, you would use the Boolean AND function as shown in the preceding If statement code. Also, the properties for the number of copies and the pages to print are saved in variables. You would need to use them as counters in loops or pass them to the reporting tool that will actually do the printing process for you. (On Day 13, Working with Crystal Reports, you see how to use the Printer dialog box with an advanced printing tool.) Run your application and click the Print button to see how the interaction with the Print dialog box and the related Printer Setup dialog box allows your application to have the integrated Windows 95 feel to it.
Help
You can display a help file to your user in two different ways:
By using the help engine API functions, which requires you to define the functions and to understand how to use them
By using the Help dialog box accessible from the Common Dialog controla much easier method
By using the New HTML Help pages and displaying in an HTML browser
To use this dialog box properly, you must set the help-related properties to point to a formatted Windows help file (.HLP):
HelpFile specifies the path and filename of a Windows help file.
HelpCommand sets the type of help display requested.
The HelpCommand settings that you'd normally use is cdlHelpContents, which tells the help engine to display the contents topic in the specified help file. To see how this works, add one last command button to the form in the open project, and then insert the following code in its Click event routine:
 Set the name of the help file
    dlgFileSelect.HelpFile = c:\program files\Microsoft Visual _
    Studio\Common\Tools\Reports\crw.HLP
    dlgFileSelect.HelpCommand = cdlHelpContents
 Display Visual Basic Help contents topic.
    dlgFileSelect.ShowHelp

 
< previous page page_65 next page >

If you like this book, buy it!